
#pragma once

#ifndef _Toolkit_h_
#define _Toolkit_h_

#include "../d3d/d3dUtility.h"

namespace Framework {

class Toolkit {
public:
    static bool CheckLineBox(d3d::BoundingBox box, D3DXVECTOR3 L1, D3DXVECTOR3 L2, D3DXVECTOR3 &Hit);
    static bool CheckLineSphere(d3d::BoundingSphere sphere, D3DXVECTOR3 L1, D3DXVECTOR3 L2);
    static void GetVertices(const d3d::BoundingBox* boundingBox, D3DXVECTOR4* vertices);
    static int RandomInt();
    static int RandomInt(int min, int max);
    static double RandomFloat();
    static double RandomFloat(double min, double max);
private:
    static int GetIntersection(float fDst1, float fDst2, D3DXVECTOR3 P1, D3DXVECTOR3 P2, D3DXVECTOR3 &Hit);
    static int InBox(D3DXVECTOR3 Hit, d3d::BoundingBox box, const int Axis);
};

}

#endif
